﻿capital = 613 # Nanjing

oob = "CHI_1936"
if = {
	limit = { has_dlc = "Man the Guns" }
		set_naval_oob = "CHI_1936_naval_mtg"
	else = {
		set_naval_oob = "CHI_1936_naval_legacy"
	}
}
if = {
	limit = { has_dlc = "By Blood Alone" }
		set_air_oob = "CHI_1936_air_bba"
	else = {
		set_air_oob = "CHI_1936_air_legacy"
		set_technology = {
			early_fighter = 1
			early_bomber = 1
		}
	}
}

recruit_character = CHI_chiang_kaishek
recruit_character = CHI_zhang_guotao
recruit_character = CHI_wang_jingwei
recruit_character = CHI_weng_wenhao
recruit_character = CHI_tu_yuming
recruit_character = CHI_hsueh_yueh
recruit_character = CHI_tai_anlan
recruit_character = CHI_wang_yaowu
recruit_character = CHI_sun_li_jen
recruit_character = CHI_hu_zongnan
recruit_character = CHI_gu_zhutong
recruit_character = CHI_wei_lihuang
recruit_character = CHI_fu_zuoyi
recruit_character = CHI_zhang_xueliang
recruit_character = CHI_fang_zeyi
recruit_character = CHI_zhu_de
recruit_character = CHI_chen_cheng
recruit_character = CHI_li_zongren
recruit_character = CHI_bo_yibo
recruit_character = CHI_huang_shen
recruit_character = CHI_chen_jitang
recruit_character = CHI_wang_shuming
recruit_character = CHI_bai_chongxi
recruit_character = CHI_zhou_zhirou
recruit_character = CHI_xiao_yisu
recruit_character = CHI_chen_shaokuan
recruit_character = CHI_xiao_jinguang
recruit_character = CHI_yu_hanmou
recruit_character = CHI_he_yingqin
recruit_character = CHI_gao_zhihang
recruit_character = CHI_h_h_kung
recruit_character = CHI_chen_guofu
recruit_character = CHI_chiang_ching_kuo
recruit_character = CHI_chen_yi
recruit_character = CHI_soong_mei_ling
recruit_character = CHI_random_prince_of_terror
recruit_character = CHI_lin_sen

set_stability = 0.2
set_war_support = 0.5
# Starting tech
set_technology = {
	infantry_weapons = 1
	gw_artillery = 1
	interwar_antiair = 1
	mass_assault = 1
	fleet_in_being = 1
	basic_train = 1
}
if = {
	limit = {
		has_dlc = "No Step Back"
	}
	set_technology = {
		gwtank_chassis = 1
	}
	else = {
		set_technology = {
			gwtank = 1
		}
	}
}
if = {
	limit = { not = { has_dlc = "Man the Guns" } }
	set_technology = {
		early_destroyer = 1
		early_light_cruiser = 1
	}
}
if = {
	limit = { has_dlc = "Man the Guns" }
	set_technology = {
		basic_naval_mines = 1
		early_ship_hull_light = 1
		early_ship_hull_cruiser = 1
		basic_battery = 1
		basic_torpedo = 1
		coastal_defense_ships = 1
	}
}

add_ideas = {
	german_advisors
}

600 = { #Jiangxi
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
749 = { #Huangshan
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
606 = { #Anhui
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
607 = { #Henan
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
620 = { #Hubei
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
602 = { #Hunan
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
750 = { #Changde
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
744 = { #Xian
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
605 = { #Sichuan
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
748 = { #Zunyi
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
603 = { #Guizhu
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
615 = { #Shanxi
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
622 = { #Shaanxi
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
325 = { #Yunnan
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}
325 = { #Dali
	add_dynamic_modifier = { modifier = dense_rural_infrastructure }
}

if = {
	limit = {
		NOT = {
			has_dlc = "Waking the Tiger"
		}
	}
	add_ideas = {
		CHI_communist_uprisings
	}
}


if = {
	limit = {
		has_dlc = "Waking the Tiger"
	}		
	add_ideas = {
		CHI_nine_power_treaty
		CHI_army_corruption_1
		CHI_ineffective_bureaucracy
		CHI_incompetent_officers
		free_trade
		CHI_hyper_inflation_1
	}
}
save_global_event_target_as = WTT_current_china_leader

set_convoys = 40

1939.1.1 = {
    add_ideas = { CHI_partisan_activity }
    remove_ideas = german_advisors
	add_political_power = 1198
	add_command_power = 100
	set_stability = 0.5
	set_war_support = 0.7
	
	if = {
		limit = { has_dlc = "Waking the Tiger" }
		complete_national_focus = CHI_unified_industrial_planning
		complete_national_focus = CHI_mission_to_germany
		complete_national_focus = CHI_rural_reconstruction_movement
		complete_national_focus = CHI_british_cooperation
		unlock_national_focus = CHI_fighter_purchases
		complete_national_focus = CHI_mission_to_the_us
		complete_national_focus = CHI_mission_to_the_soviet_union
		complete_national_focus = CHI_hire_chennault
		complete_national_focus = CHI_rapprochement_with_soviet_union
		complete_national_focus = CHI_invite_soviet_advisers
		complete_national_focus = CHI_military_affairs_commission
		complete_national_focus = CHI_burma_road
		unlock_national_focus = CHI_the_soviet_volunteer_group
		complete_national_focus = CHI_bureau_of_investigation_and_statistics
		complete_national_focus = CHI_camco
		complete_national_focus = CHI_three_principles_of_the_people
		complete_national_focus = CHI_army_reform
		complete_national_focus = CHI_nationalism
		else = {
			#generic focuses
			complete_national_focus = army_effort
			complete_national_focus = equipment_effort
			complete_national_focus = motorization_effort
			complete_national_focus = aviation_effort
			complete_national_focus = naval_effort
			complete_national_focus = flexible_navy
			complete_national_focus = industrial_effort
			complete_national_focus = construction_effort
			complete_national_focus = production_effort
		}
	}

	add_ideas = {
		#laws
		war_economy
		service_by_requirement
		closed_economy

		#ministers
		CHI_bo_yibo
		CHI_xiao_yisu
		CHI_chen_shaokuan
		jiangnan_shipyard_group
		camco

	}
	if = {
		limit = {
			has_dlc = "Waking the Tiger"
		}
		remove_ideas = CHI_army_corruption_1
		add_ideas = {
			#national spirits
			CHI_hyper_inflation_1
			CHI_nine_power_treaty
			CHI_army_corruption_2
			CHI_ineffective_bureaucracy
			CHI_incompetent_officers
			free_trade
			CHI_military_affairs_commission
		}
	}
	
	set_global_flag = fall_of_nanjing
	create_faction = chinese_united_front
	add_to_faction = PRC
	remove_opinion_modifier = { target = PRC modifier = hostile_status }
	#load_oob = "CHI_united_front"
	set_global_flag = CHI_unite
	
	oob = "CHI_1939"
	if = {
		limit = { has_dlc = "By Blood Alone" }
			set_air_oob = "CHI_1939_air_bba"
		else = {
			set_air_oob = "CHI_1939_air_legacy"
		}
	}
	if = {
		limit = { has_dlc = "Man the Guns" }
			set_naval_oob = "CHI_1939_naval_mtg"
		else = {
			set_naval_oob = "CHI_1939_naval_legacy"
		}
	}
	set_technology = {

		#PLACEHOLDER techs for vehicles
		motorised_infantry = 1
		tech_support = 1		
		tech_recon = 1
		tech_engineers = 1

		#doctrines
		air_superiority = 1
		pocket_defence = 1
		defence_in_depth = 1
		battlefleet_concentration = 1
		convoy_sailing = 1

		#electronics
		electronic_mechanical_engineering = 1
		radio = 1
		radio_detection = 1
		mechanical_computing = 1
		computing_machine = 1
		basic_encryption = 1
		basic_decryption = 1

		#industry
		basic_machine_tools = 1
		improved_machine_tools = 1
		advanced_machine_tools = 1
		synth_oil_experiments = 1
		fuel_silos = 1
		oil_processing = 1
		improved_oil_processing = 1
		construction1 = 1
		construction2 = 1
		construction3 = 1
		concentrated_industry = 1
		concentrated_industry2 = 1
		concentrated_industry3 = 1
	}
}

set_politics = {
	ruling_party = neutrality
	last_election = "1936.1.1"
	election_frequency = 48
	elections_allowed = no
}

set_popularities = {
	neutrality = 100
}

add_opinion_modifier = { target = PRC modifier = hostile_status }

### VARIANTS ###
# 1936 Start #
if = {
	limit = { not = { has_dlc = "Man the Guns" } }
}
if = {
	limit = { has_dlc = "Man the Guns" }
	# Destroyers #
	create_equipment_variant = {
		name = "Jianwei Class"			
		type = ship_hull_light_1
		name_group = CHI_DD_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_light_battery_1
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = light_ship_engine_1
			fixed_ship_torpedo_slot = empty
			mid_1_custom_slot = empty
			rear_1_custom_slot = empty
		}
	}
	# Light Cruisers #
	create_equipment_variant = {
		name = "Hairong Class"					# Hairong protected cruisers and Zhaohe, Yingrui training cruisers
		type = ship_hull_cruiser_coastal_defense_ship
		name_group = CHI_CL_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_light_medium_battery_1
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_1
			fixed_ship_armor_slot = ship_armor_cruiser_1
			mid_1_custom_slot = empty
			mid_2_custom_slot = empty
			rear_1_custom_slot = empty
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Haiqi Class"
		type = ship_hull_cruiser_coastal_defense_ship
		name_group = CHI_CL_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_medium_battery_1
			fixed_ship_anti_air_slot = empty
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_1
			fixed_ship_secondaries_slot = ship_secondaries_1
			fixed_ship_armor_slot = ship_armor_cruiser_1
			mid_1_custom_slot = empty
			mid_2_custom_slot = empty
			rear_1_custom_slot = empty
		}
		obsolete = yes
	}
	create_equipment_variant = {
		name = "Ninghai Class"
		type = ship_hull_cruiser_1
		name_group = CHI_CL_HISTORICAL
		parent_version = 0
		modules = {
			fixed_ship_battery_slot = ship_light_medium_battery_1
			fixed_ship_anti_air_slot = ship_anti_air_1
			fixed_ship_fire_control_system_slot = ship_fire_control_system_0
			fixed_ship_radar_slot = empty
			fixed_ship_engine_slot = cruiser_ship_engine_1
			mid_1_custom_slot = ship_torpedo_1
			mid_2_custom_slot = empty
			rear_1_custom_slot = empty
		}
	}
}


1941.1.1 = {
	oob = "CHI_1941"
	set_technology = {
		improved_light_tank = 1 
		basic_light_tank = 1
		basic_medium_tank = 1 
		CAS1 = 1
		CAS2 = 1
		heavy_fighter1 = 1
		gw_artillery = 1
		interwar_artillery = 1
		interwar_antitank = 1
		infantry_weapons2 = 1
		infantry_weapons1 = 1
		improved_infantry_weapons = 1
		support_weapons = 1
		support_weapons2 = 1
		paratroopers = 1
		basic_heavy_cruiser = 1
		improved_heavy_cruiser = 1
		improved_battleship = 1
		early_carrier = 1
		basic_carrier = 1
		improved_carrier = 1
		improved_medium_tank = 1
		tech_engineers2 = 1
		tech_recon2 = 1
		tech_field_hospital = 1
		artillery1 = 1
		artillery2 = 1
		artillery3 = 1
		antitank1 = 1
		antitank2 = 1
		antitank3 = 1
		basic_destroyer = 1
		improved_destroyer = 1
		improved_light_cruiser = 1
		basic_light_cruiser = 1
		early_heavy_cruiser = 1
		early_battlecruiser = 1
		early_battleship = 1
		early_submarine = 1
		basic_battlecruiser = 1
		landing_craft = 1

		#doctrines 
		pocket_defence = 1
		defence_in_depth = 1
		large_front_operations = 1
		deep_operations = 1
		#fleet
		fleet_in_being = 1
		battlefleet_concentration = 1
		convoy_sailing = 1
		subsidiary_carrier_role = 1
		#air 
        formation_flying = 1		
		dive_bombing = 1
		direct_ground_support = 1
		fighter_ace_initiative = 1

     	#electronics
		electronic_mechanical_engineering = 1
		radio = 1
		radio_detection = 1
		decimetric_radar = 1
		mechanical_computing = 1
		computing_machine = 1
		basic_encryption = 1
		basic_decryption = 1
		improved_computing_machine = 1
		improved_decimetric_radar = 1
		improved_encryption = 1
		improved_decryption = 1

		#industry
		basic_machine_tools = 1
		improved_machine_tools = 1
		advanced_machine_tools = 1
		assembly_line_production = 1
		synth_oil_experiments = 1
		oil_processing = 1
		improved_oil_processing = 1
		construction1 = 1
		construction2 = 1
		construction3 = 1
		construction4 = 1
		concentrated_industry = 1
		concentrated_industry2 = 1
		concentrated_industry3 = 1
		concentrated_industry4 = 1
    }
}

1942.1.1 = {
	oob = "CHI_1942"
	add_ideas = { low_war_casualties } #approximately 3 million casualties in June 1942
}

1943.1.1 = {
	oob = "CHI_1943"
}

1944.1.1 = {
	oob = "CHI_1944"
	remove_ideas = { low_war_casualties }
	add_ideas = { medium_war_casualties } #approximately 4-6 million military casualties in June 1942 and the total population is 150m so 2.5% is the closest representation of casualties
	set_technology = {

		#electronics
		electronic_mechanical_engineering = 1
		radio = 1
		decimetric_radar = 1
		improved_decimetric_radar = 1
		#doctrine

		#industry
		fuel_refining = 1
		
		construction1 = 1
		construction2 = 1
		construction3 = 1

		excavation1 = 1



		basic_machine_tools = 1
		improved_machine_tools = 1

		fuel_silos = 1

		#weapons
		support_weapons = 1
		support_weapons2 = 1

		infantry_weapons = 1
		infantry_weapons1 = 1
		#infantry_weapons2 = 1

		interwar_antitank = 1
		antitank1 = 1

		gw_artillery = 1
		interwar_artillery = 1
		artillery1 = 1
		
		antiair1 = 1
		antiair2 = 1

		motorised_infantry = 1

		tech_support = 1

		tech_engineers = 1
		tech_engineers2 = 1
		tech_engineers3 = 1

		tech_recon = 1
		tech_field_hospital = 1
		tech_military_police = 1
	}
	if = {
		limit = { has_dlc = "By Blood Alone" }
			set_technology = {
				photo_reconnaisance = 1

				#survivability_studies = 1

				aa_lmg = 1
				#aa_hmg = 1

				#aa_cannon_1 = 1
				#aa_cannon_2 = 1
				
				engines_1 = 1
				engines_2 = 1
				#engines_3 = 1

				#range_improvements = 1

				early_bombs = 1

				#aircraft_construction = 1
				
				engines_1 = 1
				engines_2 = 1

				iw_small_airframe = 1
				basic_small_airframe = 1
				#improved_small_airframe = 1
				#advanced_small_airframe = 1

				iw_medium_airframe = 1
				basic_medium_airframe = 1
				#improved_medium_airframe = 1

				iw_large_airframe = 1
				#basic_large_airframe = 1
				#improved_large_airframe = 1
				#advanced_large_airframe = 1

				air_torpedoe_1 = 1
				#air_torpedoe_2 = 1
			}
		else = {
			set_technology = {

				naval_bomber1 = 1

				CAS1 = 1
				#CAS2 = 1
		
				early_fighter = 1
				fighter1 = 1
				#fighter2 = 1
				#fighter3 = 1
		
				heavy_fighter1 = 1
				#heavy_fighter2 = 1
		
				strategic_bomber1 = 1
				#strategic_bomber2 = 1
		
				tactical_bomber1 = 1
				#tactical_bomber2 = 1
			}
		}
	}
}

1945.1.1 = {
	oob = "CHI_1944_D"
}